package cn.edu.zafu.bigdata.linfeifei;
public class Course {
    private String cname; // 课程名称
    private String chour; // 课程编号
    private int ccredit; // 学分
    private String cdesc; // 课程描述    // 构造函数
    public Course(String cname, String chour, int ccredit, String cdesc) {
        this.cname = cname;
        this.chour = chour;
        this.ccredit = ccredit;
        this.cdesc = cdesc;    }    // 输出课程信息的方法
    public void printCourseInfo() {
        System.out.println("Course Name:" + cname);
        System.out.println("Course ID: " + chour);
        System.out.println("Credits: "+ ccredit);
        System.out.println("Description: " + cdesc);    }    // Getter 和 Setter 方法
    public String getCname() {
        return cname;    }
    public void setCname(String cname) {
        this.cname = cname;    }
    public String getChour() {
        return chour;    }
    public void setChour(String chour) {
        this.chour = chour;    }
    public int getCcredit() {
        return ccredit;    }
    public void setCcredit(int ccredit) {
        this.ccredit = ccredit;    }
    public String getCdesc() {
        return cdesc;    }
    public void setCdesc(String cdesc) {
        this.cdesc = cdesc;    }
    // 主函数，用于测试Course类
    public static void main(String[] args) {
// 创建一个Course对象
        Course course = new Course("Introduction to Computer Science", "CS101", 4, "This course introduces the basics of computer science.");
// 打印课程信息
        course.printCourseInfo(); }
    }
